<style>
body{margin:0px;font-size:16px;font-family: times New Roman,Arial;color:#777777}
</style>

<?php 
$w0=46;
$w1=210;
$w2=30;
$w3=92;
$w=520;
?>


        	<table border="0" cellspacing="0" cellpadding="0" style='line-height:14px;width:<? echo $w;?>px'>
              <tr>
              	<td ></td>
                <td style='text-align:left;vertical-align:top; padding-top:18px;width:195px'><?php echo date('d', $this->inbound->inbound_create_time) ;?><span style='width:53px;display:inline-block'></span><?php echo date('m', $this->inbound->inbound_create_time) ;?><span style='display:inline-block;width:55px'></span><?php echo date('y', $this->inbound->inbound_create_time) ;?></td>
                 <td style='text-align:left;vertical-align:top;width:100px'>
                        <?php echo $this->inbound->inbound_code ;?>
                </td>
              </tr>
            </table>
            
       
    <table width="100%" border="0" cellspacing="0" style='line-height:22px;margin-top:32px;width: <? echo $w;?>px'>       
     <tr>
        <td style='padding-left:80px'><?php echo $this->company_name;?></td>
      </tr>
      <tr>
        <td style='padding-left:120px'><?php echo $this->reason_content;?></td>
      </tr>
    </table>
    
       
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style='line-height:22px;border-collapse:collapse;margin-top:28px;width: <? echo $w;?>px'>            
 	                      	<?php 
 	                      	$no=1;$product_product_group_code="";
 	                      	$total=-1; 	                      	
 	                      	foreach ($this->inbound_details as $inbound_detail)
 	                      	{
 	                      		if( $product_product_group_code!=$inbound_detail->m_Array['product_product_group_code'] )
 	                      		{
 	                      			$product_product_group_code=$inbound_detail->m_Array['product_product_group_code'];
 	                      			if($total>-1)
 	                      			{
 	                      	?>
 	                      	<tr>
 	                      		<td></td>
 	                      		<td style='text-align: center;font-weight:bold'>Cộng:</td>
 	                      		<td></td>
 	                      		<td style='text-align:right;padding-right:4px'><?php echo $total;?></td>
 	                      		<td colspan='2'></td>
 	                      	</tr>
 	                      	<?php 
 	                      			}
 	                      			$total=0;
 	                  		?>
 	                  		<tr>
 	                  			<td></td>
 	                  			<td style='text-align: center;font-weight:bold'><?php echo $inbound_detail->m_Array['product_group_name'];?></td>
 	                  			<td colspan="4"></td>
 	                  		</tr>
 	                  		<?php     			
 	                      		}
 	                      		$inbound_detail_product_quantity=$inbound_detail->inbound_detail_product_quantity;  
 	                      		$total+=$inbound_detail_product_quantity;
 	                      	?>
                            <tr>
                            	<td style='width:<?php echo $w0;?>px;text-align:center'></td>
                            	<td style='width:<?php echo $w1;?>px;text-align:left'><?php echo $inbound_detail->m_Array['product_name']?></td>
                            	<td style='width:<?php echo $w2;?>px;text-align:center'><?php echo $inbound_detail->m_Array['unit_name']?></td>
                            	<td style='width:<?php echo $w3;?>px;text-align:right;padding-right:2px'><?php echo $inbound_detail->inbound_detail_product_quantity?></td>
                            	<td colspan='2' style='text-align:center'><?php echo $inbound_detail->inbound_detail_lot_code?></td>
                            </tr>
                            <?php 
 	                      	}
 	                      	if($total>-1)
 	                      	{
 	                      	?>
 	                      	<tr>
 	                      		<td></td>
 	                      		<td style='text-align: center;font-weight:bold'>Cộng:</td>
 	                      		<td></td>
 	                      		<td style='text-align:right;padding-right:2px'><?php echo $total;?></td>
 	                      		<td colspan='2'></td>
 	                      	</tr>
 	                      	<?php 
 	                      	}
 	                      	?>
                    </table>
   
<!-- <div style='position:absolute;top:576px;left:<?php echo $w0+$w1+$w2;?>px;width:<?php echo $w3;?>px;text-align: center;'><?php echo $total?></div> -->